Repository navigation
runtime: programmable sample positions only for multisampled targets, so 1x depth images stay plain (RT-SAMPLE-LOCATIONS-MSAA-ONLY) - #2649
Merged
aslan2142 merged 1 commit intoNov 29, 2026
Conversation
…(RT-SAMPLE-LOCATIONS-MSAA-ONLY) ProjectLeonida#778 filled the sample-locations grids from 1 sample upwards, so every 1x depth-stencil image was created sample-locations compatible and carried sample locations through its transitions. D3D12 only has programmable sample positions for multisampled targets; since ProjectLeonida#778 the world phase loses the device on an RTX 5080. Keep 1 sample out (SamplePositions::programmable_count): 1x depth images are plain again, MSAA keeps the feature. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Gt9hwPPpwX5RYWwXCnj43U
Contributor
|
Independent synthetic A/B of the merged change. A was
This exercises the synthetic Vulkan depth and MSAA paths under Wine. AI-assisted with OpenAI Codex. |
4 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Claimed in the coordination issue as: RT-SAMPLE-LOCATIONS-MSAA-ONLY (claim)
What and why
#778 (D3D-SAMPLE-POSITIONS) fills the Vulkan sample-locations grids for every sample count from 1 upwards. The device reports sample locations for 1 sample, so every single-sample depth-stencil image is then created with
VK_IMAGE_CREATE_SAMPLE_LOCATIONS_COMPATIBLE_DEPTH_BIT_EXT, and each of its layout transitions carries aVkSampleLocationsInfoEXT. D3D12 only has programmable sample positions for multisampled targets, so this touches images the feature never needed.Since #778 reached
main, the Vulkan runtime loses the device in the world phase on an RTX 5080:a fence's counter read UINT64_MAX and vkDeviceWaitIdle then returned VK_ERROR_DEVICE_LOST, 100 to 230 s into every run.This change keeps 1 sample out of the grids (
SamplePositions::programmable_count), so a 1x depth image is created and transitioned exactly as before #778. The tier-2 condition is now checked on the multisampled framebuffer counts. #778 required a grid for every count, 1x included, so without this the device would drop to tier 1 and #778'sd3d12_sample_grid_resettest would be skipped. MSAA images keep #778's programmable positions, and the reported tier stays the same.How the cause was found: a bisect of the 26 runtime pull requests between a
mainthat ran 600 s without a loss (c22a0a732) and one that lost the device (4364a4fa6). The runtime alone reproduces it, with shaders from the good translator. The last good point and the first bad point differ only by #778 on the runtime side.The mechanism (why the flag and the barrier info on 1x depth images fault on NVIDIA, likely together with the title's aliased placed depth memory) is read in code, not measured: the runs had no driver fault report (
LEONIDA_DEVICE_FAULT=2, NVIDIA diagnostics config off).Tested
command_list_testwith the new checks. With only the test change,maindoes not build it, becauseprogrammable_countdoes not exist there. With this change it passes.d3d12_msaa_draw,d3d12_custom_samplesandd3d12_sample_grid_resetpass.d3d12_sample_grid_reset(tier 2) still runs.ctest(540 tests, no XMA decoder,-j 20):main: 2 failures,windows_crash_monitorandxbox_present.d3d12_queue_wait_timeout(timeout) andd3d12_meshunder the parallel load. Both pass when run alone, 2 of 2, onmainand on this change.gta6rtlinks without the XMA decoder, and its imports are identical tomain(30 DLLs).WS2_32is already imported onmainand is not added here.gta6rt, cold 300 s runs, one run each):main7bbc1d2main7bbc1d2 + this changemain4364a4fmain4364a4f + an earlier one-line version (grids from 2)GPUs tested: NVIDIA GeForce RTX 5080 16 GB, driver 621.24, Windows 11
AI-assisted: yes (Claude Code, for DadaCap)
Checklist
mainand merges cleanly. Also merges cleanly with [integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6) #2566 at1d0867c4a, so no rebase of [integration] PageMirror, GPU detile, async queue & RDNA2->SPIR-V performance stack (INTEGRATION-PERF-CPU-GPU-R6) #2566.check_no_game_data.pypasses on the 3 files), including in logs or reports quoted here.docs/design.md(n/a, runtime only).🤖 Generated with Claude Code
https://claude.ai/code/session_01Gt9hwPPpwX5RYWwXCnj43U